package com.mioto.ld.component;

import lombok.Getter;

/**
 * @author mioto-qinxj
 * @date 2024/5/22
 * @desc 关系运算符
 */
@Getter
public enum RelationOperationEnum {

    CONDITION_TYPE_GT(1,">"),
    CONDITION_TYPE_GTE(2,">="),
    CONDITION_TYPE_LT(3,"<"),
    CONDITION_TYPE_LTE(4,"<=");

    public static RelationOperationEnum getInstance(int value){
        for (RelationOperationEnum relationOperationEnum : RelationOperationEnum.values()) {
            if (relationOperationEnum.value == value){
                return relationOperationEnum;
            }
        }
        return null;
    }

    RelationOperationEnum(int value, String operator){
        this.value = value;
        this.operator = operator;
    }

    private int value;

    private String operator;
}
